In an existing video transmission application environment, various networks exist, including wired networks and wireless networks. These networks have different data error probabilities, that is, the reliability of signal transmission is different. For example, in a video transmission network, a video stream provided by a video server is forwarded by a media gateway (Media Gateway), and the media gateway extracts and sends the video substreams required by other networks. For video stream applications, a delay and packet loss in network transmission may cause that a video packet is unavailable, so that quality of a decoded video decreases severely. Generally, in a wired network, a packet loss rate is relatively low, and a transmission rate is relatively high. However, a wireless network (the networks such as WLAN, 3G network based on a base station, and GPRS) is the contrary. In a wired network, the data packet loss rate is relatively low, and packet loss is mainly caused by congestion of routers in the network. However, in a wireless network, a high packet loss rate is caused by limited bandwidth, high delay, and high bit error rate.
Because the error probability in a wireless environment is far greater than that in a wired environment, the video server should provide an error control function to enable seamless switching among these different networks when a video user accesses video data. An existing error control technology includes error tolerance transcoding. That is, a video server provides a stream suitable for a wired network, and then a transcoder is added at the network border so that redundancy suitable for the target network is provided for the video stream. A video agent is used as a transcoder to decode an original stream and then encode it, which increases complexity of the transcoder, and also increases a system delay. The existing error control technology further includes redundant frame coding, which aims at using redundant information to protect a series of compressed images, so that the compressed images have the ability to recover from errors or impact caused by communication errors on the compressed images is reduced. However, this method generates redundant frames in the case of a given packet loss rate, which may cause a waste of network resources. For example, in a wired channel from the video server to the first data forwarding node and in the wireless channel from the first data forwarding node to the second data forwarding node, the error probability of the former channel is lower than that of the latter channel. However, in order for the user after the second data forwarding node to obtain better video decoding quality, the video server needs to add much redundancy in the stream, thereby causing a waste of bandwidth in the channel from the video server to the first data forwarding node.
In the implementation of the present invention, the inventor finds the prior art has at least the following problems: In at least two transmission networks with different packet loss rates in the prior art, a stream is generated according to a fixed packet loss rate. If the stream is generated according to a high packet loss rate, the redundancy is excessive, and therefore the utilization rate of bandwidth resources is low; or, if the stream is generated according to a low packet loss rate, the video quality deteriorates when the network conditions become worse.